<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <link rel="icon" type="image/svg+xml" href="../../../assets/favicon.ico" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Recording Device Control -- Agora</title>
  <link rel="stylesheet" href="./jquery.jsonview.min.css">
  <link rel="stylesheet" href="../../../assets/bootstrap.min.css">
  <link rel="stylesheet" href="../../../common/common.css">
</head>

<body>
  <div class="container">
    <!-- left -->
    <section class="left">
    </section>
    <!-- right -->
    <section class="right row">
      <!-- video -->
      <div class="video-group col-md-12 col-lg-6">
        <!-- local stream -->
        <section class="card">
          <div class="card-header">
            local stream
          </div>
          <div class="card-body">
            <div id="local-player" class="player">
              <div class="card-text local-player-name" id="local-player-name"></div>
            </div>
          </div>
        </section>
        <!-- remote stream -->
        <section class="card">
          <div class="card-header">
            remote stream
          </div>
          <div class="card-body">
            <div id="remote-playerlist"></div>
          </div>
        </section>
      </div>
      <!-- form -->
      <div class="form-wrapper col-lg-6">
        <form id="join-form" name="join-form">
          <div class="join-info-group">
            <div class="form-item">
              <label class="form-label">Channel</label>
              <input class="form-control" id="channel" type="text" placeholder="enter channel name" required>
              <div class="tips">If you don`t know what is your channel, checkout <a
                  href="https://docs.agora.io/en/Agora%20Platform/terms?platform=All%20Platforms#channel">this</a></div>
            </div>
            <div class="form-item">
              <label class="form-label">User ID(optional)</label>
              <input class="form-control" id="uid" type="text" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')"
                onafterpaste="this.value=this.value.replace(/[^0-9]/g,'')" placeholder="Enter the user ID">
            </div>
          </div>

          <div class="button-group">
            <button id="join" type="submit" class="btn btn-primary btn-sm">Join</button>
            <button id="leave" type="button" class="btn btn-primary btn-sm" disabled>Leave</button>
            <button id="startNetworkTest" type="submit" class="btn btn-primary btn-sm">Start Network Test</button>
          </div>

        </form>
      </div>
      <!-- app info -->
      <div id="app-info"></div>
    </section>
  </div>

  <!-- device test modal -->
  <div class="modal fade" id="model-device-test" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title">Media Device Test</h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body">
          <!-- Microphone -->
          <section>
            <h5 class="device-name">Microphone</h5>
            <label class="form-label">Produce sounds to check if the mic works.</label>
            <select class="form-select mic-list" id="" required="" style="max-width: 300px;">
              <option value="Default">Default</option>
            </select>
            <div class="progress mt-2 mb-2">
              <div class="progress-bar bg-success" role="progressbar" aria-valuenow="0" aria-valuemin="0"
                aria-valuemax="100"></div>
            </div>
          </section>
          <!-- Camera -->
          <section>
            <h5 class="device-name">Camera</h5>
            <div label class="form-label">Move in front of the camera to check if it works.</div>
            <select class="form-select cam-list" id="">
              <option value="Default">Default</option>
            </select>
            <div id="pre-local-player" class="player mt-2" style="width: 334px;height: 200px;"></div>
          </section>
        </div>
      </div>
    </div>
  </div>


  <!-- network test modal -->
  <div class="modal fade" id="model-network-test" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title">Network Test</h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body">
          <!-- Uplink -->
          <h5 id="1">Uplink</h5>
          <div class="card-deck">
            <div class="card demo-card">
              <div class="card-body">
                <h6 class="card-title">Network Quality </h6>
                <div id="uplink-network-quality"></div>
              </div>
            </div>
            <div class="card demo-card">
              <div class="card-body">
                <h6 class="card-title">Local Audio Stats</h6>
                <div id="local-audio-stats"></div>
              </div>
            </div>

            <div class="card demo-card">
              <div class="card-body">
                <h6 class="card-title">Local Video Stats</h6>
                <div id="local-video-stats"></div>
              </div>
            </div>
          </div>
          <!-- Downlink -->
          <h5 id="2">Downlink</h5>
          <div class="card-deck">
            <div class="card demo-card">
              <div class="card-body">
                <h6 class="card-title">Network Quality</h6>
                <div id="downlink-network-quality"></div>
              </div>
            </div>

            <div class="card demo-card">
              <div class="card-body">
                <h6 class="card-title">Remote Audio Stats</h6>
                <div id="remote-audio-stats"></div>
              </div>
            </div>
            <div class="card demo-card">
              <div class="card-body">
                <h6 class="card-title">Remote Video Stats</h6>
                <div id="remote-video-stats"></div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>



  <script src="../../../assets/jquery-3.4.1.min.js"></script>
  <script src="./jquery.jsonview.min.js"></script>
  <script src="../../../assets/bootstrap.bundle.min.js"></script>
  <script src="../../../common/constant.js"></script>
  <script src="../../../sso/index.js"></script>
  <script src="../../../common/utils.js"></script>
  <script src="../../../common/left-menu.js"></script>
  <script src="../../../i18n/language.js"></script>
  <script src="https://download.agora.io/sdk/release/AgoraRTC_N.js"></script>
  <script src="./index.js"></script>
</body>

</html>
